package com.icoolkj.mall.order01.config.demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * @author icoolkj
 * @version 1.0
 * @description
 * @createDate 2025/01/26 00:08
 */
@EnableScheduling
@EnableDiscoveryClient
@SpringBootApplication
public class Order01ConfigDemoApplication {
    public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(Order01ConfigDemoApplication.class, args);

        while (true){
            String quantity = applicationContext.getEnvironment().getProperty("order.quantity");
            System.out.println("quantity -->" +quantity);
            try {
                Thread.sleep(3000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }

    }
}
